package com.service.bean.area;

import com.service.bean.area.Area;
import com.service.bean.point.Point;
import com.service.tools.Tools;

public class LineArea extends Area {

	@Override
	public boolean isInArea(Point p){
		boolean check = false;
		for(int i=0;i<this.points.size()-1;i++){
			Point p1 = this.points.get(i);
			Point p2 = this.points.get(i+1);	
			double linehight = Tools.pointToLine(p1,p2,p);
			if(linehight < this.lineWidth){
				check=true;			
			}
		}
		return check;
	}
	
}
